import React from 'react';
import { createBrowserRouter,Navigate } from 'react-router-dom';
import Login from '../pages/Login';
import Dashboard from '../pages/Dashboard';
import OperationOverview from '../pages/OperationOverview';
import ArticlePublish from '../pages/ArticlePublish';
import ArticleComment from '../pages/ArticleComment';
import ContractManage from '../pages/ContractManage';
import CustomerManage from '../pages/CustomerManage';
import TenantManage from '../pages/TenantManage';
import TenantStaffManage from '../pages/TenantStaffManage';
import TenantStaffCreate from '../pages/TenantStaffCreate';
import BuildingManage from '../pages/BuildingManage';
import BuildingCreate from '../pages/BuildingCreate';
import PublicResource from '../pages/PublicResource';
import CarBill from '../pages/CarBill';
import TenantBill from '../pages/TenantBill';
import ArticleCreate from '../pages/ArticleCreate';
import ContractCreate from '../pages/ContractCreate';
import CustomerCreate from '../pages/CustomerCreate';
import TenantCreate from '../pages/TenantCreate';
import PublicResourceCreate from '../pages/PublicResourceCreate';
import CarBillCreate from '../pages/CarBillCreate';
import TenantBillCreate from '../pages/TenantBillCreate';
import VisualMain from '../visualFile/visualFilejsx/VisualMain'
import VisualCockpit from '../visualFile/visualFilejsx/VisualCockpit'
import VisualManage from '../visualFile/visualFilejsx/VisualManage'
import VisualDeplete from '../visualFile/visualFilejsx/VisualDeplete'
import VisualInvestment from '../visualFile/visualFilejsx/VisualInvestment'


const router = createBrowserRouter([
  {path: '/login',element: <Login />},
  {path:'/dashboard/visual',element:<VisualMain/>,children:[
    {path:"/dashboard/visual/cockpit",element:<VisualCockpit/>},
    {path:"/dashboard/visual/investment",element:<VisualInvestment/>},
    {path:"/dashboard/visual/manage",element:<VisualManage/>},
    {path:"/dashboard/visual/deplete",element:<VisualDeplete/>},
    {path:"/dashboard/visual",element:<Navigate to="/dashboard/visual/cockpit"/>}
]},
  {path: '/',element: <Navigate to="/login" />},
  {path: '/dashboard',element: <Dashboard />},
  {path: '/dashboard/enterprise',element: <OperationOverview />},
  {path: '/dashboard/property',element: <Dashboard />},
  {path: '/dashboard/energy',element: <Dashboard />},
  {path: '/dashboard/gate',element: <Dashboard />},
  {path: '/article/publish',element: <ArticlePublish />},
  {path: '/article/comment',element: <ArticleComment />},
  {path: '/article/create',element: <ArticleCreate />},
  {path: '/business/contract',element: <ContractManage />},
  {path: '/business/contract/create',element: <ContractCreate />},
  {path: '/business/customer',element: <CustomerManage />},
  {path: '/business/customer/create',element: <CustomerCreate />},
  {path: '/tenant/info',element: <TenantManage />},
  {path: '/tenant/staff',element: <TenantStaffManage />},
  {path: '/tenant/staff/create',element: <TenantStaffCreate />},
  {path: '/tenant/create',element: <TenantCreate />},
  {path: '/building-manage',element: <BuildingManage />},
  {path: '/building/create',element: <BuildingCreate />},
  {path: '/public-resource',element: <PublicResource />},
  {path: '/public-resource/create',element: <PublicResourceCreate />},
  {path: '/car-bill',element: <CarBill />},
  {path: '/car-bill/create',element: <CarBillCreate />},
  {path: '/tenant-bill',element: <TenantBill />},
  {path: '/tenant-bill/create',element: <TenantBillCreate />},
])
export default router;


// export default function Router() {
//   return (
//     <Routes>
//   
//       <Route path="/article/publish" element={<ArticlePublish />} />
//       <Route path="/article/comment" element={<ArticleComment />} />
//       <Route path="/article/create" element={<ArticleCreate />} />
//       <Route path="/business/contract" element={<ContractManage />} />
//       <Route path="/business/contract/create" element={<ContractCreate />} />
//       <Route path="/business/customer" element={<CustomerManage />} />
//       <Route path="/business/customer/create" element={<CustomerCreate />} />
//       <Route path="/tenant/info" element={<TenantManage />} />
//       <Route path="/tenant/staff" element={<TenantStaffManage />} />
//       <Route path="/tenant/staff/create" element={<TenantStaffCreate />} />
//       <Route path="/tenant/create" element={<TenantCreate />} />
//       <Route path="/building-manage" element={<BuildingManage />} />
//       <Route path="/building/create" element={<BuildingCreate />} />
//       <Route path="/public-resource" element={<PublicResource />} />
//       <Route path="/public-resource/create" element={<PublicResourceCreate />} />
//       <Route path="/car-bill" element={<CarBill />} />
//       <Route path="/car-bill/create" element={<CarBillCreate />} />
//       <Route path="/tenant-bill" element={<TenantBill />} />
//       <Route path="/tenant-bill/create" element={<TenantBillCreate />} />
//     </Routes>
//   );
// }
